<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- //通过 vlaueOf()  getTime()  获取 1970-现在的毫秒数 -->
    <script>
        //方法一
        var date = new Date();
        console.log(date.valueOf());
        console.log(date.getTime());
        //方法二
        var date1 = +new Date();
        console.log(date1);
        //方法三
        console.log(Date.now());

    </script>
</head>

<body>

</body>

</html>